package org.grow.took.exception;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

//统一异常处理aop
//能够捕获controller里的异常，包括service dao
//
@RestControllerAdvice
public class ExceptionBridge {
    @ExceptionHandler(SeptemberException.class)
    public ResponseEntity<String> sepEx(SeptemberException e){
        return new ResponseEntity<String>(e.getMessage(),
                null,e.getCode());

    }

}
